package com.member.shop.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.member.common.utils.DateUtils;
import com.member.shop.domain.SysBizFeedback;
import com.member.shop.mapper.SysBizFeedbackMapper;
import com.member.shop.service.ISysBizFeedbackService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;

/**
 * 意见反馈Service业务层处理
 *
 * @author thomas
 * @date 2024-11-09
 */
@Service
public class SysBizFeedbackServiceImpl extends ServiceImpl<SysBizFeedbackMapper, SysBizFeedback> implements ISysBizFeedbackService {
    @Resource
    private SysBizFeedbackMapper sysBizFeedbackMapper;

    /**
     * 查询意见反馈
     *
     * @param id 意见反馈主键
     * @return 意见反馈
     */
    @Override
    public SysBizFeedback selectSysBizFeedbackById(Long id) {
        return sysBizFeedbackMapper.selectById(id);
    }

    @Override
    public List<SysBizFeedback> selectSysBizFeedbackList(LambdaQueryWrapper<SysBizFeedback> queryWrapper) {
        return this.sysBizFeedbackMapper.selectList(queryWrapper);
    }

    /**
     * 查询意见反馈列表
     *
     * @param queryWrapper 意见反馈
     * @return 意见反馈
     */
    @Override
    public List<SysBizFeedback> selectSysBizFeedbackList(SysBizFeedback queryWrapper) {
        return sysBizFeedbackMapper.selectSysBizFeedbackList(queryWrapper);
    }

    /**
     * 新增意见反馈
     *
     * @param sysBizFeedback 意见反馈
     * @return 结果
     */
    @Override
    public int insertSysBizFeedback(SysBizFeedback sysBizFeedback) {
        sysBizFeedback.setCreateTime(DateUtils.getNowDate());
        return sysBizFeedbackMapper.insert(sysBizFeedback);
    }

    /**
     * 修改意见反馈
     *
     * @param sysBizFeedback 意见反馈
     * @return 结果
     */
    @Override
    public int updateSysBizFeedback(SysBizFeedback sysBizFeedback) {
        sysBizFeedback.setUpdateTime(DateUtils.getNowDate());
        return sysBizFeedbackMapper.updateById(sysBizFeedback);
    }

    /**
     * 批量删除意见反馈
     *
     * @param ids 需要删除的意见反馈主键
     * @return 结果
     */
    @Override
    public int deleteSysBizFeedbackByIds(Long[] ids) {
        return sysBizFeedbackMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除意见反馈信息
     *
     * @param id 意见反馈主键
     * @return 结果
     */
    @Override
    public int deleteSysBizFeedbackById(Long id) {
        return sysBizFeedbackMapper.deleteById(id);
    }
}
